#!perl -T

use strict;
use Test::More tests => 4;

BEGIN {
  *CORE::GLOBAL::exit = sub { return shift };
  use_ok('Nagios3::Plugin');
}

my $output = '';

close STDOUT;
open STDOUT, '>', \$output or die "Can't open STDOUT: $!";
my $nagios = Nagios3::Plugin->new('TEST');
$nagios->exit;
is($output, "TEST UNKNOWN - \n");

close STDOUT;
open STDOUT, '>', \$output or die "Can't open STDOUT: $!";
$nagios = Nagios3::Plugin->new('DEMO');
$nagios->exit(WARNING);
is($output, "DEMO WARNING - \n");


ok(1);
